home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 26 / Cream of the Crop 26.iso / program / ddj0897.zip / RCSC.ZIP / LIB51 / STRNCAT.C < prev    next >
C/C++ Source or Header  |  1997-01-12  |  272b  |  18 lines

  1. /*
  2. ** concatenate n bytes max from t to end of s 
  3. ** s must be large enough
  4. */
  5. strncat(s, t, n) char *s, *t; int n; {
  6.   char *d;
  7.   d = s;
  8.   --s;
  9.   while(*++s) ;
  10.   while(n--) {
  11.     if(*s++ = *t++) continue;
  12.     return(d);
  13.     }
  14.   *s = 0;
  15.   return(d);
  16.   }
  17.  
  18.